Skip to content

Commit

Permalink
chroe: Tarea para generar el sitio web
Browse files Browse the repository at this point in the history
Genera la versión HTML y un index.html
  • Loading branch information
jesustorresdev committed Sep 14, 2021
1 parent fdbc024 commit 4bb7bb8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: bundle exec rake tests:all

- name: Generar la documentación
run: bundle exec rake build:html build:pdf DOCUMENT_NAME=sistemas_operativos HTML_MULTIPAGE=1
run: bundle exec rake build:site build:pdf DOCUMENT_NAME=sistemas_operativos

- name: Publicar web
uses: JamesIves/[email protected]
Expand All @@ -58,7 +58,7 @@ jobs:
TARGET_FOLDER: ${{ steps.branch_name.outputs.SOURCE_NAME }}
CLEAN: true

- name: Publicar en 'Releases'
- name: Publicar el PDF en 'Releases'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
24 changes: 24 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,28 @@ task :config do |t|
/github\.(io|com).*\/ssoo-apuntes/
]
}
end

namespace :build do

desc 'Generar el sitio web donde se alojan los apuntes'
task :site do
ENV['HTML_MULTIPAGE'] = '1'
Rake::Task['build:html'].invoke

output_directory = File.dirname(Rake::Task['build:html'].prerequisites.first)
open(File.join(output_directory, 'index.html'), 'w') do |f|
f << <<~EOF
<!DOCTYPE HTML>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name='robots' content='noindex,nofollow'>
<meta http-equiv="refresh" content="0;url=main.html">
<link rel="canonical" href="main.html">
</head>
</html>
EOF
end
end
end

0 comments on commit 4bb7bb8

Please sign in to comment.