From 5a3ec519172cbff7d4b2070e2fe93bee1583e65e Mon Sep 17 00:00:00 2001 From: Rawand Date: Sun, 27 Jun 2021 08:30:40 +0300 Subject: Project/Publication Multi links Improvement (#42) --- archetypes/projects.md | 5 ++++- archetypes/publications.md | 10 ++++++---- exampleSite/content/projects/proj1.md | 3 ++- exampleSite/content/projects/proj2.md | 3 +++ exampleSite/content/publications/pub1.md | 10 ++++++---- exampleSite/content/publications/pub2.md | 8 ++++---- layouts/partials/projects/projects.html | 9 +++++---- layouts/partials/publications/publications.html | 23 ++++++----------------- 8 files changed, 36 insertions(+), 35 deletions(-) diff --git a/archetypes/projects.md b/archetypes/projects.md index 96d74a6..33e9026 100644 --- a/archetypes/projects.md +++ b/archetypes/projects.md @@ -6,7 +6,10 @@ title: "Your Project Title Goes Here" date: "2019-03-30" # links is used for specific links for your project +# You can have multiple links +# format is, LINK_NAME : LINK_URL links: - website: 'https://github.com/' + website: 'https://example.com/' + code: 'https://github.com/' --- diff --git a/archetypes/publications.md b/archetypes/publications.md index 7b6ef58..7b8a20b 100644 --- a/archetypes/publications.md +++ b/archetypes/publications.md @@ -7,11 +7,13 @@ date: "2018-09-01" publication: "Journal of Machine Learning" +# You can have multiple links +# format is, LINK_NAME : LINK_URL links: - url_pdf: https://github.com/hadisinaee/avicenna - url_code: https://github.com/hadisinaee/avicenna - url_slides: https://github.com/hadisinaee/avicenna - url_video: https://github.com/hadisinaee/avicenna + pdf: https://github.com/hadisinaee/avicenna + code: https://github.com/hadisinaee/avicenna + slides: https://github.com/hadisinaee/avicenna + video: https://github.com/hadisinaee/avicenna --- diff --git a/exampleSite/content/projects/proj1.md b/exampleSite/content/projects/proj1.md index 1ce3d59..ffe40ed 100644 --- a/exampleSite/content/projects/proj1.md +++ b/exampleSite/content/projects/proj1.md @@ -3,9 +3,10 @@ title: "Quisque: Tristique iaculis augue, et ornare nibh pretium in." date: "2018-05-18" +# You can have multiple links +# format is, LINK_NAME : LINK_URL links: website: 'https://github.com/hadisinaee/avicenna' - alias: link_name_here --- diff --git a/exampleSite/content/projects/proj2.md b/exampleSite/content/projects/proj2.md index 656cd14..3ef5046 100644 --- a/exampleSite/content/projects/proj2.md +++ b/exampleSite/content/projects/proj2.md @@ -3,8 +3,11 @@ title: "Vestibulum: Maecenas ac eros id libero dapibus vehicula a ut erat." date: "2019-03-30" +# You can have multiple links +# format is, LINK_NAME : LINK_URL links: website: 'https://github.com/hadisinaee/avicenna' + demo: 'https://example.com' --- [See the wiki page for tutorial!](https://github.com/hadisinaee/avicenna/wiki) \ No newline at end of file diff --git a/exampleSite/content/publications/pub1.md b/exampleSite/content/publications/pub1.md index cc9a682..c07b94e 100644 --- a/exampleSite/content/publications/pub1.md +++ b/exampleSite/content/publications/pub1.md @@ -7,11 +7,13 @@ date: "2018-09-01" publication: "Journal of Machine Learning" +# You can have multiple links +# format is, LINK_NAME : LINK_URL links: - url_pdf: https://github.com/hadisinaee/avicenna - url_code: https://github.com/hadisinaee/avicenna - url_slides: https://github.com/hadisinaee/avicenna - url_video: https://github.com/hadisinaee/avicenna + pdf: https://github.com/hadisinaee/avicenna + code: https://github.com/hadisinaee/avicenna + slides: https://github.com/hadisinaee/avicenna + video: https://github.com/hadisinaee/avicenna --- diff --git a/exampleSite/content/publications/pub2.md b/exampleSite/content/publications/pub2.md index afa158a..ec23b35 100644 --- a/exampleSite/content/publications/pub2.md +++ b/exampleSite/content/publications/pub2.md @@ -8,10 +8,10 @@ date: "2016-09-01" publication: "Journal of Machine Learning" links: - url_pdf: https://github.com/hadisinaee/avicenna - url_code: https://github.com/hadisinaee/avicenna - url_slides: https://github.com/hadisinaee/avicenna - url_video: https://github.com/hadisinaee/avicenna + pdf: https://github.com/hadisinaee/avicenna + code: https://github.com/hadisinaee/avicenna + slides: https://github.com/hadisinaee/avicenna + video: https://github.com/hadisinaee/avicenna --- [See the wiki page for tutorial!](https://github.com/hadisinaee/avicenna/wiki) \ No newline at end of file diff --git a/layouts/partials/projects/projects.html b/layouts/partials/projects/projects.html index 5711eeb..ef8659c 100644 --- a/layouts/partials/projects/projects.html +++ b/layouts/partials/projects/projects.html @@ -17,12 +17,13 @@ {{ $links := $page.Params.links }} {{ if $links }}
- {{ if $links.website }} - - {{if $links.alias}} {{$links.alias}} {{else}} website {{end}} - + {{range $link_name, $link_url := $links}} + {{ if $link_url }} + + {{$link_name}} {{end}} + {{end}}
{{end}} diff --git a/layouts/partials/publications/publications.html b/layouts/partials/publications/publications.html index 4845cd1..917e171 100644 --- a/layouts/partials/publications/publications.html +++ b/layouts/partials/publications/publications.html @@ -46,24 +46,13 @@ {{ $links := $page.Params.links }} {{ if $links }}
- {{ if $links.url_pdf }} - pdf + {{range $link_name, $link_url := $links}} + {{ if $link_url }} + + {{$link_name}} + + {{end}} {{end}} - - {{ if $links.url_code }} - code - {{end}} - - - {{ if $links.url_slides }} - slides - {{end}} - - {{ if $links.url_video }} - video - {{end}} -
{{end}} -- cgit v1.2.3