Hello,
I’m using wordpress right now for my real estate website and I’m thinking about moving to static website.
Is it possible to create a real estate website that has search functionality and importing or syncing data (property listing) from CSV to the site, so every time I update the CSV the listing on the website will be updated?
If it is possible can someone show me what I should learn in order to create the site that I want?
I only know some programming languages like HTML, CSS and a little bit of PHP because I’m using wordpress right now, and I’m more to the site owner rather than a website developer because I only building it for myself.
So any explanations, hint, or guide would be very much appreciated because I’m really interested in learning building static website.
Search functionality is available, but I haven’t implemented it myself (yet) so will let others comment on that aspect.
However, I have created a Google Sheet with data. You can publish this to the web as a csv (within Google sheets), which can then be pulled into Hugo and iterated over.
You will of course need to build Hugo after you alter the spreadsheet, and then publish, but there are several automated deployment tools available (Netifly, Wercker etc). But yes, I do believe you can do what you are looking for with some coding.
You can use CSV files to insert data into a page, but you can’t generate a new page for each entry in the CSV. If you want to do that, you’d need a separate script to generate Hugo contents file for each record in the CSV.
Yes, but what you can do it set a key value in the spreadsheet and match it with the page .params.
So yes, you would have to create a new page for each entry, but you can automatically bring in the correct row from the spreadsheet and display it via the template. For example (set column 1 of the spreadsheet (index 0) to an address like “8thestreet”, and set the front matter of the post with address: 8thestreet:
{{ range $i, $r := getCSV .Site.Params.sep .Site.Params.spreadsheetname }}
{{ if eq (index $r 0) $.Params.address }}
<li>{{ index $r 9 }}</li>
{{end}}
{{end}}
I suppose you can then as mooreason says, create a script to generate all the files. I suppose you could even replace the param with the file name, and use that as the key in the spreadsheet.
Or you could use bash to generate the .md files from your CSV file outside Hugo with a bit of regex and the csplit command in Linux/Unix and then move the files into your Hugo content directory to generate the site.
Wow! I thought I will be ignored just like on other forums.
Feel welcomed here
Thank you all for the response, really appreciate it!
I think there is a lot of things that I have to learn especially about the converting CSV to markdown files.
Anyway does Algolia search works well with Hugo? because for what that I know it works well with Jekyll.
Or is there any other options besides Algolia?
I need a search function that can be used for e-commerce and real estate website.
Actually, I have searched for it in here and I think Algolia can be used on Hugo, however, I just want to know how much compatible is Algolia with Hugo, and if there are other search functions that work better with Hugo while providing same or better functionality.