From 45d349fc8ed6865e7732aa3c037e0a964ebdd034 Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:01:24 -0300 Subject: [PATCH] Added support for multiple profiles in about page (#1243) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses #963. Supports two setups: getting profile text from page content. ```markdown --- layout: about title: about permalink: / subtitle: Affiliations. Address. Contacts. Moto. Etc. profiles: # if you want to include more than one profile, just replicate the following block # and create one content file for each profile inside _pages/ - align: right image: prof_pic.jpg # content: about_einstein.md image_circular: false # crops the image to make it circular more_info: >

555 your office number

123 your address street

Your City, State 12345

news: true # includes a list of news items selected_papers: true # includes a list of papers marked as "selected={true}" social: true # includes social icons at the bottom of the page --- Write your biography here. Tell the world about yourself. Link to your favorite [subreddit](http://reddit.com). You can put a picture in, too. The code is already in, just name your picture `prof_pic.jpg` and put it in the `img/` folder. Put your address / P.O. box / other info right below your picture. You can also disable any these elements by editing `profile` property of the YAML header of your `_pages/about.md`. Edit `_bibliography/papers.bib` and Jekyll will render your [publications page](/al-folio/publications/) automatically. Link to your social media connections, too. This theme is set up to use [Font Awesome icons](http://fortawesome.github.io/Font-Awesome/) and [Academicons](https://jpswalsh.github.io/academicons/), like the ones below. Add your Facebook, Twitter, LinkedIn, Google Scholar, or just disable all of them. ``` Or getting profile text from `content` (useful when having multiple profiles). ```markdown --- layout: about title: about permalink: / subtitle: Affiliations. Address. Contacts. Moto. Etc. profiles: # if you want to include more than one profile, just replicate the following block # and create one content file for each profile inside _pages/ - align: right image: prof_pic.jpg content: about_einstein.md image_circular: false # crops the image to make it circular more_info: >

555 your office number

123 your address street

Your City, State 12345

- align: left image: prof_pic.jpg content: about_einstein.md image_circular: false # crops the image to make it circular more_info: >

555 your office number

123 your address street

Your City, State 12345

news: true # includes a list of news items selected_papers: true # includes a list of papers marked as "selected={true}" social: true # includes social icons at the bottom of the page --- ``` Which looks like this: ![image](https://user-images.githubusercontent.com/31376482/223251956-aec09f92-55c4-4a17-8ab6-0b30da0970cc.png) --------- Signed-off-by: George Araújo Signed-off-by: George Araujo --- _layouts/about.html | 6 ++--- _layouts/profiles.html | 49 ++++++++++++++++++++++++++++++++++++++++ _pages/about.md | 4 ++-- _pages/about_einstein.md | 5 ++++ _pages/dropdown.md | 4 ++-- _pages/profiles.md | 28 +++++++++++++++++++++++ _sass/_base.scss | 2 +- 7 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 _layouts/profiles.html create mode 100644 _pages/about_einstein.md create mode 100644 _pages/profiles.md diff --git a/_layouts/about.html b/_layouts/about.html index 9a48811..38d9c23 100644 --- a/_layouts/about.html +++ b/_layouts/about.html @@ -29,9 +29,9 @@ layout: default alt=page.profile.image cache_bust=true -%} {% endif -%} - {%- if page.profile.address %} -
- {{ page.profile.address }} + {%- if page.profile.more_info %} +
+ {{ page.profile.more_info }}
{%- endif %}
diff --git a/_layouts/profiles.html b/_layouts/profiles.html new file mode 100644 index 0000000..689681f --- /dev/null +++ b/_layouts/profiles.html @@ -0,0 +1,49 @@ +--- +layout: default +--- + + +
+ +
+ {% if page.profiles -%} + {% for profile in page.profiles %} + {% unless forloop.first %} +
+ {% endunless %} +
+ {%- if profile.image %} + {%- assign profile_image_path = profile.image | prepend: 'assets/img/' -%} + + {% if profile.image_circular %} + {%- assign profile_image_class = "img-fluid z-depth-1 rounded-circle" -%} + {% else %} + {%- assign profile_image_class = "img-fluid z-depth-1 rounded" -%} + {% endif %} + + {% include figure.html + path=profile_image_path + class=profile_image_class + alt=profile.image -%} + {% endif -%} + {%- if profile.more_info %} +
+ {{ profile.more_info }} +
+ {%- endif %} +
+ +
+ {% if profile.content -%} + {% capture profile_content %}{%- include_relative {{ profile.content }} %}{% endcapture %} + {{ profile_content | markdownify }} + {%- else -%} + {{ content }} + {%- endif %} +
+ + {% endfor %} + {%- endif %} +
+ +
diff --git a/_pages/about.md b/_pages/about.md index 4a4637c..e929838 100644 --- a/_pages/about.md +++ b/_pages/about.md @@ -8,7 +8,7 @@ profile: align: right image: prof_pic.jpg image_circular: false # crops the image to make it circular - address: > + more_info: >

555 your office number

123 your address street

Your City, State 12345

@@ -23,4 +23,4 @@ Write your biography here. Tell the world about yourself. Link to your favorite Put your address / P.O. box / other info right below your picture. You can also disable any of these elements by editing `profile` property of the YAML header of your `_pages/about.md`. Edit `_bibliography/papers.bib` and Jekyll will render your [publications page](/al-folio/publications/) automatically. -Link to your social media connections, too. This theme is set up to use [Font Awesome icons](http://fortawesome.github.io/Font-Awesome/) and [Academicons](https://jpswalsh.github.io/academicons/), like the ones below. Add your Facebook, Twitter, LinkedIn, Google Scholar, or just disable all of them. +Link to your social media connections, too. This theme is set up to use [Font Awesome icons](http://fortawesome.github.io/Font-Awesome/) and [Academicons](https://jpswalsh.github.io/academicons/), like the ones below. Add your Facebook, Twitter, LinkedIn, Google Scholar, or just disable all of them. \ No newline at end of file diff --git a/_pages/about_einstein.md b/_pages/about_einstein.md new file mode 100644 index 0000000..b43d5a0 --- /dev/null +++ b/_pages/about_einstein.md @@ -0,0 +1,5 @@ +Write your biography here. Tell the world about yourself. Link to your favorite [subreddit](http://reddit.com). You can put a picture in, too. The code is already in, just name your picture `prof_pic.jpg` and put it in the `img/` folder. + +Put your address / P.O. box / other info right below your picture. You can also disable any these elements by editing `profile` property of the YAML header of your `_pages/about.md`. Edit `_bibliography/papers.bib` and Jekyll will render your [publications page](/al-folio/publications/) automatically. + +Link to your social media connections, too. This theme is set up to use [Font Awesome icons](http://fortawesome.github.io/Font-Awesome/) and [Academicons](https://jpswalsh.github.io/academicons/), like the ones below. Add your Facebook, Twitter, LinkedIn, Google Scholar, or just disable all of them. \ No newline at end of file diff --git a/_pages/dropdown.md b/_pages/dropdown.md index 7ac6574..9075471 100644 --- a/_pages/dropdown.md +++ b/_pages/dropdown.md @@ -2,9 +2,9 @@ layout: page title: submenus nav: true -nav_order: 6 +nav_order: 7 dropdown: true -children: +children: - title: publications permalink: /publications/ - title: divider diff --git a/_pages/profiles.md b/_pages/profiles.md new file mode 100644 index 0000000..c282963 --- /dev/null +++ b/_pages/profiles.md @@ -0,0 +1,28 @@ +--- +layout: profiles +title: people +permalink: /people/ +subtitle: Affiliations. Address. Contacts. Moto. Etc. +nav: true +nav_order: 6 + +profiles: + # if you want to include more than one profile, just replicate the following block + # and create one content file for each profile inside _pages/ + - align: right + image: prof_pic.jpg + content: about_einstein.md + image_circular: false # crops the image to make it circular + more_info: > +

555 your office number

+

123 your address street

+

Your City, State 12345

+ - align: left + image: prof_pic.jpg + content: about_einstein.md + image_circular: false # crops the image to make it circular + more_info: > +

555 your office number

+

123 your address street

+

Your City, State 12345

+--- \ No newline at end of file diff --git a/_sass/_base.scss b/_sass/_base.scss index cba737d..a69981b 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -120,7 +120,7 @@ blockquote { .profile { width: 100%; - .address { + .more-info { margin-bottom: 5px; margin-top: 5px; font-family: monospace;