https://www.datascienceblog.net/post/other/staticman_comments/
https://vincenttam.gitlab.io/post/2018-09-16-staticman-powered-gitlab-pages/2/
https://yasoob.me/posts/running_staticman_on_static_hugo_blog_with_nested_comments/
| 1. When enabling netlify identity and git-gateway, you can assign roles to the user, and even use roles as a store, such as "company:Bill Young Productions." | |
| 2. To protect a page, create a layout (_layouts/protected/admin.html) that inherits from default layout and protect the layout like this: | |
| --- | |
| layout: page | |
| role: admin | |
| --- | |
| <script type="text/javascript"> | |
| var allowed = user.app_metadata.roles.includes(page.role); | |
| if(!allowed) window.location.replace("/denied"); |
| # rbenv | |
| sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev lib | |
| cd | |
| git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
| exec $SHELL | |
| git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build | |
| echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| _ |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| # add this to your spec helper | |
| RSpec.configure do |config| | |
| config.treat_symbols_as_metadata_keys_with_true_values = true | |
| config.filter_run :focus => true | |
| config.run_all_when_everything_filtered = true | |
| end | |
| # and then use the :focus tag in your specs | |
| it "does something awesome", :focus do |
| # Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
| describe 'Modal' do | |
| should 'display login errors' do | |
| visit root_path | |
| click_link 'My HomeMarks' | |
| within '#login_area' do | |
| fill_in 'email', with: 'will@not.work' | |
| fill_in 'password', with: 'test' |
| **** css **** | |
| p.flash { | |
| font-family: "Trebuchet MS", arial, sans-serif; | |
| font-size: 14px; | |
| padding: 10px; | |
| } | |
| p.notice { | |
| border:1px solid #BFD6FF; | |
| color: #3774DF; |