File tree Expand file tree Collapse file tree 5 files changed +74
-55
lines changed Expand file tree Collapse file tree 5 files changed +74
-55
lines changed Original file line number Diff line number Diff line change 1+ <script >
2+ import { marked } from " marked" ;
3+ import { getRemoteFileData } from " ../../components/helpers/getRemoteFile" ;
4+ export let url;
5+ import { onMount } from " svelte" ;
6+
7+ let content = " " ;
8+ onMount (async () => {
9+ const fileData = await getRemoteFileData (url, " text" );
10+ if (fileData) {
11+ content = marked .parse (fileData);
12+ }else {
13+ content = " "
14+ }
15+ });
16+ </script >
17+
18+ {#if content == " " }
19+ <div class =" flex justify-center items-center my-10" >
20+ <div role =" status" >
21+ <svg
22+ aria-hidden =" true"
23+ class =" w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
24+ viewBox =" 0 0 100 101"
25+ fill =" none"
26+ xmlns =" http://www.w3.org/2000/svg"
27+ >
28+ <path
29+ d =" M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
30+ fill =" currentColor"
31+ />
32+ <path
33+ d =" M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
34+ fill =" currentFill"
35+ />
36+ </svg >
37+ <span class =" sr-only" >Loading...</span >
38+ </div >
39+ </div >
40+ {/if }
41+
42+ {@html content }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import ProfileLayout from "../../layouts/profileLayout.astro";
33import { members_api_url } from " ../../data/conf.json" ;
44import { marked } from " marked" ;
55import { getRemoteFileData } from " ../../components/helpers/getRemoteFile" ;
6+ import TextLoader from " ../../components/helpers/textLoader.svelte" ;
67
78const response = await fetch (members_api_url + " members-data" );
89const members_data = await response .json ();
@@ -21,16 +22,6 @@ export async function getStaticPaths() {
2122
2223const params = Astro .params ;
2324
24- let content = " " ;
25-
26- const fileData = await getRemoteFileData (
27- ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/README.md ` ,
28- " text"
29- );
30- if (fileData ) {
31- content = marked .parse (fileData );
32- }
33-
3425let noIndex = ! (" headline" in members_data [params .username ]);
3526
3627if (! noIndex ) {
@@ -44,6 +35,10 @@ if (!noIndex) {
4435<ProfileLayout profile ={ members_data [params .username ]} activeTab =" profile" pageTitle =" Perfil" noIndex ={ noIndex } >
4536 <article
4637 class =" my-5 prose-sm mx-auto px-10 py-6 prose-h2:mt-3 overflow-auto prose-a:underline prose-ul:list-disc prose-img:m-0 prose-img:inline break-words dark:text-gray-100"
47- set:html ={ content }
48- />
38+ >
39+ <TextLoader
40+ client:only =" svelte"
41+ url ={ ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/README.md ` }
42+ />
43+ </article >
4944</ProfileLayout >
Original file line number Diff line number Diff line change 11---
22import ProfileLayout from " ../../../layouts/profileLayout.astro" ;
33import { members_api_url } from " ../../../data/conf.json" ;
4- import { marked } from " marked" ;
5- import { getRemoteFileData } from " ../../../components/helpers/getRemoteFile" ;
4+ import TextLoader from " ../../../components/helpers/textLoader.svelte" ;
65
76const response = await fetch (members_api_url + " members-data" );
87const members_data = await response .json ();
@@ -20,20 +19,15 @@ export async function getStaticPaths() {
2019}
2120
2221const params = Astro .params ;
23- let content = " " ;
24-
25- const fileData = await getRemoteFileData (
26- ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/cucoders_data/resume.md ` ,
27- " text"
28- );
29- if (fileData ) {
30- content = marked .parse (fileData );
31- }
3222---
3323
34- <ProfileLayout profile ={ members_data [params .username ]} activeTab =" cv" pageTitle =" Currículo" noIndex ={ true } >
24+ <ProfileLayout profile ={ members_data [params .username ]} activeTab =" cv" pageTitle =" Currículo" noIndex ={ true } >
3525 <article
3626 class =" my-5 prose dark:prose-invert prose-sm mx-auto px-10 py-6 prose-h2:mt-3 prose-a:underline overflow-auto prose-ul:list-disc prose-img:m-0 prose-img:inline break-words"
37- set:html ={ content }
38- />
27+ >
28+ <TextLoader
29+ client:only =" svelte"
30+ url ={ ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/cucoders_data/resume.md ` }
31+ />
32+ </article >
3933</ProfileLayout >
Original file line number Diff line number Diff line change 11---
22import ProfileLayout from " ../../../layouts/profileLayout.astro" ;
33import { members_api_url } from " ../../../data/conf.json" ;
4- import { marked } from " marked" ;
5- import { getRemoteFileData } from " ../../../components/helpers/getRemoteFile" ;
4+ import TextLoader from " ../../../components/helpers/textLoader.svelte" ;
65
76const response = await fetch (members_api_url + " members-data" );
87const members_data = await response .json ();
@@ -20,20 +19,15 @@ export async function getStaticPaths() {
2019}
2120
2221const params = Astro .params ;
23- let content = " " ;
24-
25- const fileData = await getRemoteFileData (
26- ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/cucoders_data/projects.md ` ,
27- " text"
28- );
29- if (fileData ) {
30- content = marked .parse (fileData );
31- }
3222---
3323
3424<ProfileLayout profile ={ members_data [params .username ]} activeTab =" projects" pageTitle =" Proyectos" noIndex ={ true } >
3525 <article
36- class =" my-5 prose dark:prose-invert prose-sm mx-auto px-10 py-6 prose-h2:mt-3 overflow-auto prose-a:underline prose-ul:list-disc prose-img:m-0 prose-img:inline break-words"
37- set:html ={ content }
38- />
26+ class =" my-5 prose dark:prose-invert prose-sm mx-auto px-10 py-6 prose-h2:mt-3 prose-a:underline overflow-auto prose-ul:list-disc prose-img:m-0 prose-img:inline break-words"
27+ >
28+ <TextLoader
29+ client:only =" svelte"
30+ url ={ ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/cucoders_data/projects.md ` }
31+ />
32+ </article >
3933</ProfileLayout >
Original file line number Diff line number Diff line change 11---
22import ProfileLayout from " ../../../layouts/profileLayout.astro" ;
33import { members_api_url } from " ../../../data/conf.json" ;
4- import { marked } from " marked" ;
5- import { getRemoteFileData } from " ../../../components/helpers/getRemoteFile" ;
4+ import TextLoader from " ../../../components/helpers/textLoader.svelte" ;
65
76const response = await fetch (members_api_url + " members-data" );
87const members_data = await response .json ();
@@ -20,20 +19,15 @@ export async function getStaticPaths() {
2019}
2120
2221const params = Astro .params ;
23- let content = " " ;
24-
25- const fileData = await getRemoteFileData (
26- ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/cucoders_data/services.md ` ,
27- " text"
28- );
29- if (fileData ) {
30- content = marked .parse (fileData );
31- }
3222---
3323
34- <ProfileLayout profile ={ members_data [params .username ]} activeTab =" services" pageTitle =" Servicios" noIndex ={ true } >
24+ <ProfileLayout profile ={ members_data [params .username ]} activeTab =" services" pageTitle =" Servicios" noIndex ={ true } >
3525 <article
36- class =" my-5 prose dark:prose-invert prose-sm mx-auto px-10 py-6 prose-h2:mt-3 overflow-auto prose-a:underline prose-ul:list-disc prose-img:m-0 prose-img:inline break-words"
37- set:html ={ content }
38- />
26+ class =" my-5 prose dark:prose-invert prose-sm mx-auto px-10 py-6 prose-h2:mt-3 prose-a:underline overflow-auto prose-ul:list-disc prose-img:m-0 prose-img:inline break-words"
27+ >
28+ <TextLoader
29+ client:only =" svelte"
30+ url ={ ` https://raw.githubusercontent.com/${params .username }/${params .username }/main/cucoders_data/services.md ` }
31+ />
32+ </article >
3933</ProfileLayout >
You can’t perform that action at this time.
0 commit comments