Skip to content

Commit

Permalink
fix: generación del sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
jesustorresdev committed Jul 18, 2023
1 parent 0add342 commit 4d7c4fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
tags:
- '*'

env:
ACADEMIC_YEAR: 2023-2024
SITE_ROOT: https://ull-esit-sistemas-operativos.github.io/ssoo-apuntes/so2324

jobs:
build-and-publish:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -44,13 +48,13 @@ jobs:
bundle install
- name: Generar la documentación
run: bundle exec rake build:www build:pdf DOCUMENT_NAME=sistemas_operativos
run: bundle exec rake build:www[$SITE_ROOT] build:pdf DOCUMENT_NAME=sistemas_operativos

- name: Publicar web
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: output/html
folder: output/www
target-folder: ${{ steps.branch_name.outputs.SOURCE_NAME }}
clean: true

Expand All @@ -61,6 +65,6 @@ jobs:
file: output/pdf/*.pdf
tag: ${{ github.ref }}
file_glob: true
release_name: "Curso 20XX-20XY"
body: "Apuntes de sistemas operativos del curso 20XX-20XY."
release_name: "Curso ${{ env.ACADEMIC_YEAR }}"
body: "Apuntes de sistemas operativos del curso ${{ env.ACADEMIC_YEAR }}."
overwrite: true
4 changes: 2 additions & 2 deletions lib/tasks/build_www.rake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Project::documents.each do |document|
end
end

task :www_sitemap do |t, args|
task :www_sitemap, [:site_root] do |t, args|
args.with_defaults(:site_root => CONFIG[:site_root])

output_directory = document[:output_directories][:www]
Expand All @@ -64,7 +64,7 @@ Project::documents.each do |document|
Dir.glob('*.html', base: output_directory).each do |filename|
f << <<~EOF
<url>
<loc>#{URI.join(args.site_root, URI.encode_www_form_component(filename))}</loc>
<loc>#{URI.parse([args.site_root, URI.encode_www_form_component(filename)].join('/'))}</loc>
<lastmod>#{now}</lastmod>
<priority>#{filename == 'main.html' ? 1.0 : 0.5}</priority>
</url>
Expand Down

0 comments on commit 4d7c4fa

Please sign in to comment.