Skip to content

Commit f384aac

Browse files
scottyhqpre-commit-ci[bot]dcherianbenbovy
authored
Flexible indexing blog post (#795)
* copy over indexing post draft * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * temoporarily switch paths for pr preview * fix asset paths, update banner * banner image * more edits * labeled schematic figure * justus review + other edits * Xarray Indexes -> Flexible Indexes Co-authored-by: Deepak Cherian <[email protected]> * dcherian's -> ours Co-authored-by: Deepak Cherian <[email protected]> * index -> Index Co-authored-by: Deepak Cherian <[email protected]> * Clearer note language Co-authored-by: Deepak Cherian <[email protected]> * clarify RangeIndex slice selection Co-authored-by: Deepak Cherian <[email protected]> * code formatting Co-authored-by: Deepak Cherian <[email protected]> * geotransform interpretation Co-authored-by: Deepak Cherian <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * xvec geometry index clarification Co-authored-by: Deepak Cherian <[email protected]> * Nod to geopandas Co-authored-by: Deepak Cherian <[email protected]> * link to index gallery in tldr Co-authored-by: Deepak Cherian <[email protected]> * remaining dcherian review comments, minor edits * match title and banner * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * Update src/posts/flexible-indexing/index.md Co-authored-by: Benoit Bovy <[email protected]> * benoit review + final edits --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian <[email protected]> Co-authored-by: Benoit Bovy <[email protected]>
1 parent e04905f commit f384aac

File tree

10 files changed

+2579
-14
lines changed

10 files changed

+2579
-14
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,46 @@ You can start editing the page by modifying `pages/index.js`. The page auto-upda
4949
<img src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg">
5050
</p>
5151
</a>
52+
53+
## Authoring blog post tips
54+
55+
1. To create a new blog post a good place to start is copying a subfolder under `src/posts/`, so, for example https://xarray.dev/blog/flox is written here https://github.com/xarray-contrib/xarray.dev/blob/e04905f5ea039eb2eb848c0b4945beee323900e4/src/posts/flox/index.md
56+
57+
### Static assets
58+
59+
Once you have `src/posts/newpost/index.md` start writing! If you want to include figures or other static assets, they go into a matching `public/posts/newpost` folder. But! reference an images without the `public` part of the path like this:
60+
61+
```html
62+
<p align="center">
63+
<img src="/posts/newpost/figure.png" />
64+
</p>
65+
```
66+
67+
### Xarray HTML reprs
68+
69+
To include an html repr, you must save it first:
70+
71+
```python
72+
with open('da-repr.html', 'w') as f:
73+
f.write(da._repr_html_())
74+
```
75+
76+
Then put it into the post's static assets folder `public/posts/newpost/da-repr.html`. And finally in `src/posts/newpost/index.md` you can include it with this syntax:
77+
78+
```
79+
<RawHTML filePath='/posts/newpost/da-repr.html' />
80+
```
81+
82+
### Toggling visibilty of sections (markdown comments)
83+
84+
While authoring, you might want to toggle specific sections on and off during rendering. You can do that with this syntax:
85+
86+
```
87+
{/* This is a comment that won't be rendered! */}
88+
```
89+
90+
### Landing page banner
91+
92+
If you'd like to add a link to the latest blog post on the landing page banner, edit this section here:
93+
94+
https://github.com/xarray-contrib/xarray.dev/blob/e04905f5ea039eb2eb848c0b4945beee323900e4/src/components/layout.js#L18

0 commit comments

Comments
 (0)