Skip to content

Commit

Permalink
allow to add/edit buttons in the head section
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Nov 21, 2019
1 parent ea895c0 commit 3bdea0f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 23,485 deletions.
2 changes: 1 addition & 1 deletion app/assets/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const merge = require('webpack-merge');
const common = require('./webpack.config.js');
const common = require('./webpack.common.js');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');

module.exports = merge(common, {
Expand Down
45 changes: 38 additions & 7 deletions app/views/sections/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@
"default": "#"
}
]
},
{
"name": "Button",
"type": "button",
"settings": [
{
"label": "Label",
"id": "text",
"type": "text",
"default": "Action"
},
{
"label": "Link",
"id": "link",
"type": "url",
"default": "#"
}
]
}
],
"global_content": {
Expand Down Expand Up @@ -59,6 +77,13 @@
"text": "Documentation",
"link": "https://doc.locomotivecms.com"
}
},
{
"type": "button",
"settings": {
"text": "Sign in",
"link": "https://station.locomotive.works/_app/sign_in"
}
}
]
}
Expand All @@ -81,17 +106,23 @@
<div id="navbar-menu" class="navbar-menu">
<div class="navbar-end">
{% for block in section.blocks %}
{% capture link %}{{ block.settings.link }}{% endcapture %}
<a class="navbar-item {% if link contains page.fullpath %}is-active{% endif %}" href="{{ link }}" {{ block.settings.link_new_window_attribute }} {{ block.locomotive_attributes }} >
<span>{{ block.settings.text }}</span>
</a>
{% if block.type == 'page' %}
{% capture link %}{{ block.settings.link }}{% endcapture %}
<a class="navbar-item {% if link contains page.fullpath %}is-active{% endif %}" href="{{ link }}" {{ block.settings.link_new_window_attribute }} {{ block.locomotive_attributes }} >
<span>{{ block.settings.text }}</span>
</a>
{% endif %}
{% endfor %}

<div class="navbar-item">
<div class="buttons">
<a class="button is-primary is-inverted is-outlined">
Sign in
</a>
{% for block in section.blocks %}
{% if block.type == 'button' %}
<a class="button is-primary is-inverted is-outlined" href="{{ block.settings.link }}" {{ block.locomotive_attributes }} {{ block.locomotive_attributes }}>
{{ block.settings.text }}
</a>
{% endif %}
{% endfor %}
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 3bdea0f

Please sign in to comment.