Skip to content

Commit 0d32b10

Browse files
committed
refactor: Remove deprecated deploy-api workflow and update deploy.yml for improved GitHub Pages deployment
style: Add new CSS file for theme styling and update imports in index.ts docs: Update TODO list with CSS rendering fix
1 parent 5f764f3 commit 0d32b10

7 files changed

Lines changed: 113 additions & 184 deletions

File tree

.github/workflows/deploy-api.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Deploy to GitHub Pages
22

3-
env:
4-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
5-
63
on:
4+
push:
5+
branches:
6+
- main
77
workflow_dispatch:
88

99
permissions:
@@ -18,39 +18,43 @@ concurrency:
1818
jobs:
1919
build:
2020
runs-on: ubuntu-latest
21+
2122
steps:
2223
- name: Checkout
2324
uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 1
26-
- uses: pnpm/action-setup@v2
25+
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v2
28+
2729
- name: Setup Node
2830
uses: actions/setup-node@v4
2931
with:
3032
node-version: 20
3133
cache: pnpm
34+
3235
- name: Setup Pages
3336
uses: actions/configure-pages@v5
37+
3438
- name: Install dependencies
3539
run: pnpm install
40+
3641
- name: Build with VitePress
3742
run: |
3843
pnpm docs:build
3944
touch docs/.vitepress/dist/.nojekyll
45+
4046
- name: Upload artifact
41-
id: deployment
4247
uses: actions/upload-pages-artifact@v3
4348
with:
4449
path: docs/.vitepress/dist
4550

4651
deploy:
47-
environment:
48-
name: github-pages
49-
url: ${{ steps.deployment.outputs.page_url }}
5052
needs: build
5153
runs-on: ubuntu-latest
52-
name: Deploy
54+
55+
environment:
56+
name: github-pages
57+
5358
steps:
5459
- name: Deploy to GitHub Pages
55-
id: deployment
56-
uses: actions/deploy-pages@v4
60+
uses: actions/deploy-pages@v4

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
- Improve site
44
- Improve renderization time
5+
- Fix CSS render on online website

docs/.vitepress/config.mts

Lines changed: 53 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ import { generateFeed, generateImages, generateMeta } from './hooks'
1616
import { defs, emojiRender } from './markdown/emoji'
1717
import { headersPlugin } from './markdown/headers'
1818
import { toggleStarredPlugin } from './markdown/toggleStarred'
19-
// import { transformsPlugin } from './transformer'
2019
import { replaceNoteLink } from './utils/markdown'
2120

2221
// @unocss-include
2322

24-
// Sitio desplegado en https://interneto.github.io/
25-
const baseUrl = '/' // for root GitHub Pages domain
23+
// Base del sitio (correcto para https://interneto.github.io/)
24+
const base = '/'
25+
26+
// Helper para evitar rutas absolutas rotas
27+
const withBase = (p: string): string =>
28+
`${base}${p.replace(/^\/+/, '')}`
29+
2630
export default defineConfig({
2731
title: 'Interneto Links',
2832
description: meta.description,
@@ -31,73 +35,50 @@ export default defineConfig({
3135
lastUpdated: false,
3236
cleanUrls: true,
3337
appearance: true,
34-
base: baseUrl,
38+
base,
39+
3540
srcExclude: ['README.md', 'single-page', 'z/**', 'apps-import/**'],
3641
ignoreDeadLinks: true,
42+
3743
sitemap: {
3844
hostname: meta.hostname
3945
},
46+
4047
head: [
4148
['meta', { name: 'theme-color', content: '#7bc5e4' }],
4249
['meta', { name: 'og:type', content: 'website' }],
4350
['meta', { name: 'og:locale', content: 'en' }],
44-
['link', { rel: 'icon', href: '/favicon.ico' }],
45-
['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' }],
46-
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' }],
47-
// PWA
48-
['link', { rel: 'manifest', href: '/manifest.json' }],
49-
['link', { rel: 'alternate icon', href: '/favicon.ico' }],
50-
['link', { rel: 'mask-icon', href: '/note.svg', color: '#000000ff' }],
51-
['meta', { name: 'keywords', content: meta.keywords.join(' ') }],
52-
['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png', sizes: '180x180' }],
51+
52+
['link', { rel: 'icon', href: withBase('favicon.ico') }],
53+
['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: withBase('favicon-32x32.png') }],
54+
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: withBase('favicon-16x16.png') }],
55+
56+
['link', { rel: 'manifest', href: withBase('manifest.json') }],
57+
['link', { rel: 'alternate icon', href: withBase('favicon.ico') }],
58+
['link', { rel: 'mask-icon', href: withBase('note.svg'), color: '#000000ff' }],
59+
['link', { rel: 'apple-touch-icon', href: withBase('apple-touch-icon.png'), sizes: '180x180' }],
60+
5361
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
5462
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'default' }],
55-
// Bing site verification
56-
[
57-
'meta',
58-
{
59-
name: 'msvalidate.01',
60-
content: 'F3028112EF6F929B562F4B18E58E3691'
61-
}
62-
],
63-
// Google site verification
64-
[
65-
'meta',
66-
{
67-
name: 'google-site-verification',
68-
content: 'XCq-ZTw6VJPQ7gVNEOl8u0JRqfadK7WcsJ0H598Wv9E'
69-
}
70-
],
71-
// Redirect to main site if embedded in iframe
72-
[
73-
'script',
74-
{},
75-
`
76-
(function() {
77-
if (window.self !== window.top) {
78-
window.top.location = window.location.href;
79-
}
80-
})();
81-
`
82-
]
8363
],
64+
8465
transformHead: async (context) => generateMeta(context, meta.hostname),
66+
8567
buildEnd: async (context) => {
8668
generateImages(context)
8769
.then(() => generateFeed(context))
8870
.finally(() => consola.success('Success!'))
8971
},
72+
9073
vite: {
9174
css: {
9275
preprocessorOptions: {
9376
scss: {
94-
api: 'modern-compiler'
77+
charset: false
9578
}
9679
}
9780
},
98-
// ssr: {
99-
// noExternal: ['@fmhy/components']
100-
// },
81+
10182
resolve: {
10283
alias: [
10384
{
@@ -120,18 +101,23 @@ export default defineConfig({
120101
}
121102
]
122103
},
104+
123105
optimizeDeps: { exclude: ['workbox-window'] },
106+
124107
plugins: [
125108
OptimizeExclude(),
109+
126110
Terminal({
127111
console: 'terminal',
128112
output: ['console', 'terminal']
129113
}),
114+
130115
UnoCSS({
131116
configFile: fileURLToPath(
132117
new URL('../../unocss.config.ts', import.meta.url)
133118
)
134119
}),
120+
135121
AutoImport({
136122
dts: '../.cache/imports.d.ts',
137123
imports: ['vue', 'vitepress'],
@@ -141,87 +127,75 @@ export default defineConfig({
141127
filepath: './.cache/imports.json'
142128
}
143129
}),
130+
144131
VitePWA({
145132
registerType: 'autoUpdate',
133+
146134
workbox: {
147135
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
148-
runtimeCaching: [
149-
{
150-
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
151-
handler: 'CacheFirst',
152-
options: {
153-
cacheName: 'google-fonts-cache',
154-
expiration: {
155-
maxEntries: 10,
156-
maxAgeSeconds: 60 * 60 * 24 * 365 // 365 days
157-
},
158-
cacheableResponse: {
159-
statuses: [0, 200]
160-
}
161-
}
162-
}
163-
]
164136
},
137+
165138
manifest: {
166139
name: 'Interneto Links',
167140
short_name: 'Interneto',
168141
description: 'The largest collection of free stuff on the internet!',
169142
theme_color: '#000000ff',
170143
background_color: '#000000ff',
144+
171145
display: 'standalone',
172146
orientation: 'portrait',
173-
scope: '/',
174-
start_url: '/',
147+
148+
start_url: base,
149+
scope: base,
150+
175151
icons: [
176152
{
177-
src: '/favicon.ico',
178-
sizes: '16x16',
179-
type: 'image/x-icon'
180-
},
181-
{
182-
src: '/android-chrome-192x192.png',
153+
src: withBase('android-chrome-192x192.png'),
183154
sizes: '192x192',
184-
type: 'image/png',
185-
purpose: 'any maskable'
155+
type: 'image/png'
186156
},
187157
{
188-
src: '/android-chrome-512x512.png',
158+
src: withBase('android-chrome-512x512.png'),
189159
sizes: '512x512',
190-
type: 'image/png',
191-
purpose: 'any maskable'
160+
type: 'image/png'
192161
}
193162
]
194163
}
195-
}),
164+
})
196165
],
166+
197167
build: {
198-
// Shut the fuck up
199168
chunkSizeWarningLimit: Number.POSITIVE_INFINITY
200169
}
201170
},
171+
202172
markdown: {
203173
emoji: { defs },
204174
config(md) {
205175
md.use(emojiRender)
206176
md.use(toggleStarredPlugin)
207-
meta.build.api && md.use(headersPlugin)
177+
if (meta.build.api) md.use(headersPlugin)
208178
replaceNoteLink(md)
209179
}
210180
},
181+
211182
themeConfig: {
212183
search,
184+
213185
footer: {
214186
message:
215187
'<a href="https://github.com/interneto" target="_blank" rel="noopener noreferrer">GitHub</a> · <a href="https://interneto.raindrop.page/" target="_blank" rel="noopener noreferrer">raindrop.io</a> · <a href="https://twitter.com/internetoOK" target="_blank" rel="noopener noreferrer">X</a>',
216188
copyright: ${new Date().getFullYear()} Interneto. Curated link directory.`
217189
},
218190

219191
outline: 'deep',
192+
220193
logo: {
221-
src: '/icon.png',
194+
src: withBase('icon.png'),
222195
alt: 'Interneto Logo'
223196
},
197+
224198
nav,
225199
sidebar,
226200
}
227-
})
201+
})

docs/.vitepress/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { loadProgress } from './composables/nprogress'
2020
import { useThemeHandler } from './themes/themeHandler'
2121
import Layout from './Layout.vue'
2222
import Post from './PostLayout.vue'
23-
import './style.scss'
23+
import './style.css'
2424
import 'virtual:uno.css'
2525
import Feedback from './components/Feedback.vue'
2626
import FloatingVue from 'floating-vue'

0 commit comments

Comments
 (0)