spee.ch/customize.md

42 lines
1 KiB
Markdown
Raw Normal View History

2018-08-10 00:39:32 +02:00
# Configure your own spee.ch
2019-06-25 21:46:00 +02:00
_note: this guide assumes you have done the [quickstart](https://github.com/lbryio/spee.ch/blob/master/README.md) or [fullstart](https://github.com/lbryio/spee.ch/blob/master/fullstart.md) guide and have a working spee.ch server_
2018-08-10 00:39:32 +02:00
2018-08-10 01:12:02 +02:00
## Custom Components
2018-11-09 17:22:23 +01:00
The components used by spee.ch are taken from the `client/` folder, but you can override those components by defining your own in the `site/custom/` folder.
2018-10-29 22:23:51 +01:00
2018-08-10 01:12:02 +02:00
### Add a new custom Logo component.
2018-08-10 00:39:32 +02:00
2018-11-09 17:22:23 +01:00
To create your own custom component to override the defaults, create a folder and an `index.jsx` file for the component in the `site/custom/src/components/` folder.
2018-08-10 00:39:32 +02:00
2018-10-29 22:23:51 +01:00
```
2018-11-09 17:22:23 +01:00
$ cd site/custom/src/components/
2018-08-10 01:12:02 +02:00
$ mkdir Logo
$ cd Logo
$ touch index.jsx
$ nano index.jsx
```
2018-08-10 00:39:32 +02:00
2018-08-10 01:12:02 +02:00
Create a simple react component in `index.jsx`.
2018-08-10 00:39:32 +02:00
2018-08-10 01:12:02 +02:00
```
2018-08-10 00:39:32 +02:00
import React from 'react';
2018-08-10 01:12:02 +02:00
2018-08-10 00:39:32 +02:00
function Logo () {
2018-08-10 01:12:02 +02:00
return (
<p>My Logo</p>
);
2018-08-10 00:39:32 +02:00
};
2018-08-10 01:12:02 +02:00
2018-08-10 00:39:32 +02:00
export default Logo;
```
Rebuild and restart the server, and you should see your site with a new Logo in the top left corner!
```
$ npm run build
```
Then
2018-08-10 01:12:02 +02:00
```
$ npm run start
```