diff --git a/_authors/clara.md b/_authors/clara.md index 6ee277910e3d1d82a14b47d195583c016390fc16..4e52b97615ba546abc7d9a962ca21c9e9d12193f 100644 --- a/_authors/clara.md +++ b/_authors/clara.md @@ -1,6 +1,6 @@ --- -short_name: clara -name: Clara Terrier +name: clara +display_name: Clara Terrier position: Secrétaire --- tip tap top diff --git a/_authors/lucas.md b/_authors/lucas.md index 9e714a38975de7a9f476fe1c8642cc10ea9e40e8..2fc800cb2fedabf4b36527c55932708badf12e7a 100644 --- a/_authors/lucas.md +++ b/_authors/lucas.md @@ -1,6 +1,6 @@ --- -short_name: lucas -name: Lucas Schneider +name: lucas +display_name: Lucas Schneider position: Président --- Lulu président! diff --git a/_data/navigation.yml b/_data/navigation.yml index df9b21cf87f65961102a98a2b6523a179b6109b7..3a731b8da790c65590dcbd160f010ba785427287 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -1,8 +1,9 @@ -- name: Home - link: / -- name: About - link: /about.html -- name: Blog - link: /blog.html -- name: Staff - link: /staff.html +items: + - name: Home + link: / + - name: About + link: /about.html + - name: Blog + link: /blog.html + - name: Staff + link: /staff.html diff --git a/_includes/navigation.html b/_includes/navigation.html index 65910e5b1fa2bd5babcc6308eacb24ceb2140ad6..c684d5d029cc4e86e9c8366382e0d39aec9ee477 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -1,6 +1,6 @@ <nav> - {% for item in site.data.navigation %} - <a href="{{ item.link }}" {% if page.url == item.link %}style="color: red;"{% endif %}> + {% for item in site.data.navigation.items %} + <a href="{{ site.baseurl }}{{ item.link }}" {% if page.url == item.link %}style="color: red;"{% endif %}> {{ item.name }} </a> {% endfor %} diff --git a/_layouts/author.html b/_layouts/author.html index 2e08aacf9fe778a48fb47e5b77d0a3df7efa2aaf..96c9ec3a3025df95c2c4f9c2e7c1aca218a48604 100644 --- a/_layouts/author.html +++ b/_layouts/author.html @@ -1,5 +1,5 @@ <!-- _layouts/author.html --> -<h1>{{ page.name }}</h1> +<h1>{{ page.display_name }}</h1> <h2>{{ page.position }}</h2> {{ content }} diff --git a/_layouts/default.html b/_layouts/default.html index e55958c52eaed03d5d78a78e836abe1391c91a00..cf6af5233f59d899364511b237ae9860b2160e09 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -3,10 +3,22 @@ <head> <meta charset="utf-8"> <title>{{ page.title }}</title> + <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> </head> <body> {% include navigation.html %} {{ content }} + <script> + if (window.netlifyIdentity) { + window.netlifyIdentity.on("init", user => { + if (!user) { + window.netlifyIdentity.on("login", () => { + document.location.href = "/admin/"; + }); + } + }); + } + </script> </body> <footer> default layout diff --git a/_layouts/post.html b/_layouts/post.html index e4acd37c9dbd301d28a2d2aced1b563ea0ae1364..c0f80ecc9792c1f787177ea49341b8b010f1d47e 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -3,9 +3,9 @@ <p> {{ page.date | date_to_string }} - {% assign author = site.authors | where: 'short_name', page.author | first %} + {% assign author = site.authors | where: 'name', page.author | first %} {% if author %} - - <a href="{{ author.url }}">{{ author.name }}</a> + - <a href="{{ author.url }}">{{ author.display_name }}</a> {% endif %} </p> diff --git a/admin/config.yml b/admin/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..53fae39bf3eb4117a99353a1aa961763937aedde --- /dev/null +++ b/admin/config.yml @@ -0,0 +1,67 @@ +# config.yml + +backend: + name: git-gateway + branch: master # Branch to update (optional; defaults to master) +media_folder: 'assets/uploads' +collections: + - name: 'blog' + label: 'Blog' + folder: '_posts/' + create: true + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' + editor: + preview: false + fields: + - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'post' } + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Publish Date', name: 'date', widget: 'datetime' } + - { + label: 'Author', + name: 'author', + widget: 'relation', + collection: 'authors', + displayFields: [display_name], + searchFields: [display_name], + valueField: 'name', + } + - { label: 'Body', name: 'body', widget: 'markdown' } + - name: 'authors' + label: 'Authors' + folder: '_authors/' + create: true + editor: + preview: false + fields: + - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'author' } + - { label: 'Short Name', name: 'name', widget: 'string' } + - { label: 'Diplay Name', name: 'display_name', widget: 'string' } + - { label: 'Position', name: 'position', widget: 'string' } + - { label: 'Body', name: 'body', widget: 'markdown' } + - name: 'pages' + label: 'Pages' + editor: + preview: false + files: + - label: 'About Page' + name: 'about' + file: 'about.md' + fields: + - { label: 'Title', name: 'title', widget: 'hidden', default: 'about' } + - { label: 'Layout', name: 'title', widget: 'hidden', default: 'about' } + - { label: 'Body', name: 'body', widget: 'markdown' } + - name: "config" + label: "Config" + editor: + preview: false + files: + - label: "Navigation" + name: "navigation" + file: "_data/navigation.yml" + fields: + - label: "Navigation Items" + name: "items" + widget: "list" + fields: + - {label: Name, name: name, widget: string} + - {label: Link, name: link, widget: string} diff --git a/admin/index.html b/admin/index.html new file mode 100644 index 0000000000000000000000000000000000000000..941e0fe16f797dcc1fdfc80c96233cea96f79f2b --- /dev/null +++ b/admin/index.html @@ -0,0 +1,14 @@ +<!-- admin/index.html --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Content Manager</title> + <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> + </head> + <body> + <!-- Include the script that builds the page and powers Netlify CMS --> + <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script> + </body> +</html> diff --git a/staff.markdown b/staff.markdown index 572f3ef6f7781cc3bcf9d686dbc6027266827cf1..83f115869d0b402a9ba180ca094f32e71fda80a9 100644 --- a/staff.markdown +++ b/staff.markdown @@ -5,7 +5,7 @@ Staff ===== {% for author in site.authors %} - [{{ author.name }}]({{ site.baseurl }}{{ author.url }}) + [{{ author.display_name }}]({{ site.baseurl }}{{ author.url }}) {{ author.position }} {{ author.content | markdownify }}