Spaces:
Running
Running
File size: 2,570 Bytes
6b70860 c24ea90 941cf22 439762d 941cf22 c1d1666 941cf22 c1d1666 c24ea90 c1d1666 20eea38 a0cad0d c1d1666 6b70860 c1d1666 c24ea90 6b70860 b8e1b6c c24ea90 c1d1666 a4b9560 c24ea90 c1d1666 c24ea90 33b2b3a c24ea90 c1d1666 33b2b3a e904bd4 a0cad0d 941cf22 a0cad0d c1d1666 941cf22 2225c34 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
import Sidenote from '../../../components/Sidenote.astro';
import Note from '../../../components/Note.astro';
## Getting Started
### Installation
The recommended way is to **duplicate this Space** on **Hugging Face** rather than cloning it directly:
1. Open the Space: **[π€ science-blog-template](https://huggingface.co/spaces/tfrere/science-blog-template)**<br/> and click `Duplicate this Space`.
2. Give it a **name**, choose **visibility**, and keep the **free CPU instance**.
3. **Clone** your new Space repository.
```bash
git clone git@hf.co:spaces/<your-username>/<your-space>
cd <your-space>
```
<br/>
4. Use **Node.js 20 or newer**. <br/>To manage versions, consider using **nvm**
- macOS/Linux: see [nvm-sh](https://github.com/nvm-sh/nvm)
- Windows: see [nvm-windows](https://github.com/coreybutler/nvm-windows)
```bash
nvm install 20
nvm use 20
node -v
```
5. Install lfs and pull files from the repository.
```bash
git lfs install
git lfs pull
```
<Note emoji="β οΈ" variant="danger">If you attempt to push binary files without Git LFS installed, you will encounter an error.</Note>
6. Install dependencies.
```bash
cd app
npm install
```
<Sidenote>
Alternatively, you can use **Yarn** as your package manager.
</Sidenote>
<br/>And that's it!
**You're ready to go!** π
### Development
```bash
npm run dev
```
Once started, the dev server is available at `http://localhost:4321`.
### Build
```bash
npm run build
```
### Deploy
**Every push** automatically triggers a **build** and **deploy** on Spaces.
```bash
# Make edits locally, then:
git add .
git commit -m "Update content"
git push
```
<Note>
Serving the `dist/` directory on any static host is enough to deliver the site.
</Note>
<Note>
A [slugified-title].pdf and thumb.jpg are also generated at build time.<br/>You can find them in the public folder and point to them at `[domain]/public/thumb.jpg`.
</Note>
### Template Synchronization
Keep your project up-to-date with the latest template improvements. The sync system fetches the most recent changes from the official template repository at `https://huggingface.co/spaces/tfrere/research-article-template` and copies them to your project.
```bash
# Preview what would be updated
npm run sync:template -- --dry-run
# Update template files (preserves your content)
npm run sync:template
```
**What gets preserved:**
- Your content in `/src/content/`
**What gets updated:**
- All template files (components, styles, configuration)
- Dockerfile and deployment configuration
- Dependencies and build system
|