Skip to content

Commit

Permalink
Merge branch 'al-folio-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
george-gca committed Feb 1, 2025
2 parents a685d62 + caf9976 commit d45f27a
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 34 deletions.
File renamed without changes.
9 changes: 5 additions & 4 deletions CUSTOMIZE.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ A variety of beautiful theme colors have been selected for you to choose from. T

## Adding social media information

You can add your social media links by adding the specified information at the `Social integration` section in the [\_config.yml](_config.yml) file. This information will appear at the bottom of the `About` page.
You can add your social media links by adding the specified information in the [\_data/socials.yml](_data/socials.yml) file. This information will appear at the bottom of the `About` page and in the search results by default, but this could be changed to appear at the header of the page by setting `enable_navbar_social: true` and doesn't appear in the search by setting `socials_in_search: false`, both in [\_config.yml](_config.yml).

## Adding a newsletter

Expand Down Expand Up @@ -182,9 +182,10 @@ Here is a list of the main components that you may want to delete, and how to do
To remove the blog, you have to:

- delete [\_posts](_posts/) directory
- delete blog page `_pages/LANG/blog.md`
- delete blog pages `_pages/LANG/blog.md`
- remove reference to blog page in our `_pages/LANG/dropdown.md`
- remove the `Blog` section in the [\_config.yml](_config.yml) file and the related parts, like the `jekyll-archives` and `latest_posts`
- remove the `latest_posts` part in `_pages/LANG/about.md`
- remove the `Blog` section in the [\_config.yml](_config.yml) file and the related parts, like the `jekyll-archives`

You can also:

Expand All @@ -203,7 +204,7 @@ To remove the news section, you can:

- delete the [\_news](_news/) directory
- delete the file [\_includes/news.liquid](_includes/news.liquid) and the references to it in the `_pages/LANG/about.md`
- remove the `announcements` part in [\_config.yml](_config.yml)
- remove the `announcements` part in [\_pages/about.md](_pages/about.md)
- remove the news part in the `Collections` section in the [\_config.yml](_config.yml) file

### Removing the projects page
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
The recommended approach for using **al-folio** is to first create your own site using the template with as few changes as possible, and only when it is up and running customize it however you like. This way it is easier to pinpoint what causes a potential issue in case of a bug. The minimum steps required to create your own site are ([video tutorial here](assets/video/tutorial_al_folio.mp4)):

1. Create a new repository using this template. For this, click on [Use this template -> Create a new repository](https://github.com/new?template_name=multi-language-al-folio&template_owner=george-gca) above the file list. If you plan to upload your site to `<your-github-username>.github.io`, note that the name of your repository :warning: **MUST BE** :warning: `<your-github-username>.github.io` or `<your-github-orgname>.github.io`, as stated in the [GitHub pages docs](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites).
2. In this new repository, go to `Settings -> Actions -> General -> Workflow permissions` and give `Read and write permissions` to GitHub Actions.
2. In this new repository, go to [Settings -> Actions -> General -> Workflow permissions](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions) and give `Read and write permissions` to GitHub Actions.
3. Open file `_config.yml`, set `url` to `https://<your-github-username>.github.io` and leave `baseurl` **empty** (do NOT delete it), as `baseurl:`.
4. Wait until the GitHub action with subtitle `Deploy site` finishes (check your repository **Actions** tab), which takes ~4 min. Now, in addition to the `main` branch, your repository has a newly built `gh-pages` branch.
5. Finally, in the repository page go to `Settings -> Pages -> Build and deployment`, make sure that `Source` is set to `Deploy from a branch` and set the branch to `gh-pages` (NOT to main).
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Maruan Al-Shedivat.
Copyright (c) 2025 Maruan Al-Shedivat.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Feel free to add your own page(s) by sending a PR.
<a href="https://vmooers.github.io/" target="_blank">★</a>
<a href="https://jpfonseca.github.io/" target="_blank">★</a>
<a href="https://dmitryryumin.github.io/" target="_blank">★</a>
<a href="https://alexiglad.github.io/" target="_blank">★</a>
</td>
</tr>
<tr>
Expand Down
10 changes: 0 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,6 @@ collections:
output: true
permalink: /:collection/:title/

announcements:
enabled: true
scrollable: true # adds a vertical scroll bar if there are more than 3 news items
limit: 5 # leave blank to include all the news in the `_news` folder

latest_posts:
enabled: true
scrollable: true # adds a vertical scroll bar if there are more than 3 new posts items
limit: 3 # leave blank to include all the blog posts

# -----------------------------------------------------------------------------
# Jekyll settings
# -----------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions _includes/distill_scripts.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,3 @@
<script src="{{ '/assets/js/search-data.js' | relative_url }}"></script>
<script src="{{ '/assets/js/shortcut-key.js' | relative_url | bust_file_cache }}"></script>
{% endif %}

{% if site.newsletter.enabled %}
<script defer src="{{ '/assets/js/newsletter.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
8 changes: 4 additions & 4 deletions _includes/latest_posts.liquid
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<div class="news">
{% if site.latest_posts != blank %}
{% if page.latest_posts != blank %}
{% assign latest_posts_size = site.posts | size %}
<div
class="table-responsive"
{% if site.latest_posts.scrollable and latest_posts_size > 3 %}
{% if page.latest_posts.scrollable and latest_posts_size > 3 %}
style="max-height: 60vw"
{% endif %}
>
<table class="table table-sm table-borderless">
{% assign latest_posts = site.posts %}
{% if site.latest_posts.limit %}
{% assign latest_posts_limit = site.latest_posts.limit %}
{% if page.latest_posts.limit %}
{% assign latest_posts_limit = page.latest_posts.limit %}
{% else %}
{% assign latest_posts_limit = latest_posts_size %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions _includes/news.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
{% assign news_size = site.news | size %}
<div
class="table-responsive"
{% if include.limit and site.announcements.scrollable and news_size > 3 %}
{% if include.limit and page.announcements.scrollable and news_size > 3 %}
style="max-height: 60vw"
{% endif %}
>
<table class="table table-sm table-borderless">
{% assign news = site.news | reverse %}
{% if include.limit and site.announcements.limit %}
{% assign news_limit = site.announcements.limit %}
{% if include.limit and page.announcements.limit %}
{% assign news_limit = page.announcements.limit %}
{% else %}
{% assign news_limit = news_size %}
{% endif %}
Expand Down
11 changes: 10 additions & 1 deletion _includes/related_posts.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@
{% endunless %}

<li class="my-2">
<a class="text-pink-700 underline font-semibold hover:text-pink-800" href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
{% if post.redirect == blank %}
<a class="text-pink-700 underline font-semibold hover:text-pink-800" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% elsif post.redirect contains '://' %}
<a class="text-pink-700 underline font-semibold hover:text-pink-800" href="{{ post.redirect }}" target="_blank">{{ post.title }}</a>
<svg width="1rem" height="1rem" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
<path d="M17 13.5v6H5v-12h6m3-3h6v6m0-6-9 9" class="icon_svg-stroke" stroke="#999" stroke-width="1.5" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
{% else %}
<a class="text-pink-700 underline font-semibold hover:text-pink-800" href="{{ post.redirect | relative_url }}">{{ post.title }}</a>
{% endif %}
</li>
{% endfor %}
{% if site.newsletter.enabled and site.footer_fixed %}
Expand Down
4 changes: 2 additions & 2 deletions _layouts/about.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ layout: default
<div class="clearfix">{{ content }}</div>

<!-- News -->
{% if page.news and site.announcements and site.announcements.enabled %}
{% if page.announcements and page.announcements.enabled %}
<h2>
<a href="{{ '/news/' | relative_url }}" style="color: inherit">{{ site.data[site.active_lang].strings.news }}</a>
</h2>
{% include news.liquid limit=true %}
{% endif %}

<!-- Latest posts -->
{% if site.latest_posts and site.latest_posts.enabled %}
{% if page.latest_posts and page.latest_posts.enabled %}
<h2>
<a href="{{ '/blog/' | relative_url }}" style="color: inherit">{{ site.data[site.active_lang].strings.latest_posts }}</a>
</h2>
Expand Down
12 changes: 10 additions & 2 deletions _pages/en-us/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ profile:
<p>123 your address street</p>
<p>Your City, State 12345</p>
news: true # includes a list of news items
latest_posts: true # includes a list of the newest posts
selected_papers: true # includes a list of papers marked as "selected={true}"
social: true # includes social icons at the bottom of the page

announcements:
enabled: true # includes a list of news items
scrollable: true # adds a vertical scroll bar if there are more than 3 news items
limit: 5 # leave blank to include all the news in the `_news` folder

latest_posts:
enabled: true
scrollable: true # adds a vertical scroll bar if there are more than 3 new posts items
limit: 3 # leave blank to include all the blog posts
---

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.
Expand Down
9 changes: 7 additions & 2 deletions _plugins/external-posts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def create_document(site, source_name, url, content)
doc.data['description'] = content[:summary]
doc.data['date'] = content[:published]
doc.data['redirect'] = url
doc.content = content[:content]
site.collections['posts'].docs << doc
end

Expand Down Expand Up @@ -90,8 +91,12 @@ def fetch_content_from_url(url)
parsed_html = Nokogiri::HTML(html)

title = parsed_html.at('head title')&.text.strip || ''
description = parsed_html.at('head meta[name="description"]')&.attr('content') || ''
body_content = parsed_html.at('body')&.inner_html || ''
description = parsed_html.at('head meta[name="description"]')&.attr('content')
description ||= parsed_html.at('head meta[name="og:description"]')&.attr('content')
description ||= parsed_html.at('head meta[property="og:description"]')&.attr('content')

body_content = parsed_html.search('p').map { |e| e.text }
body_content = body_content.join() || ''

{
title: title,
Expand Down

0 comments on commit d45f27a

Please sign in to comment.